<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<div class="content">
	
	<input type="button" class="btn btn-small btn-primary" value="添加" onclick="edit();">

	<table class="table table-bordered table-striped table-condensed">
		<thead>
			<tr>
				<th>栏目名</th>
				<th>所属目录</th>
				<th>系列文章Id</th>
				<th>排序</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${catalogs }" var="data">
				<tr>
					<td>
						<a href="${ctx }/admin/catalog/edit?id=${data.id }">
							${data.name }
						</a>
					</td>
					<td>${data.folder }</td>
					<td>${data.articleId }</td>
					<td>${data.rank }</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>

</div>

<script type="text/javascript">
	function edit() {
		window.location.href='${ctx}/admin/catalog/edit';
	}
</script>